package com.autumn.zero.authorization.application.dto.roles;

import javax.validation.constraints.NotNull;

import org.hibernate.validator.constraints.Length;

import com.autumn.common.api.application.dto.DefaultEntityDto;
import com.autumn.util.excel.annotations.ExcelColumn;
import com.autumn.util.excel.annotations.ExcelWorkbook;
import com.autumn.validation.annotation.NotNullOrBlank;
import com.autumn.zero.authorization.entitys.roles.AbstractRole;

/**
 * 
 * 角色Dto
 * 
 * @author 杨昌国 2018-12-10 13:01:31
 */
@ExcelWorkbook(exportTitle = "角色信息")
public class RoleDto extends DefaultEntityDto {

	/**
	 * 
	 */
	private static final long serialVersionUID = 8486328214684761698L;

	/**
	 * 
	 */
	@NotNull(message = "顺序不能为空")
	@ExcelColumn(order = 1, friendlyName = "顺序", width = 80)
	private Integer sortId;

	/**
	 * 角色名称
	 */
	@NotNullOrBlank(message = "角色名称不能为空")
	@Length(max = AbstractRole.MAX_NAME_LENGTH, message = "角色名称长度不能超过" + AbstractRole.MAX_NAME_LENGTH + "个字。")
	@ExcelColumn(order = 2, friendlyName = "角色名称", width = 100)
	private String name;

	/**
	 * 是否默认角色
	 */
	@ExcelColumn(order = 3, friendlyName = "默认角色", width = 60)
	private boolean isDefault;

	/**
	 * 摘要
	 */
	@Length(max = AbstractRole.MAX_SUMMARY_LENGTH, message = "角色摘要长度不能超过" + AbstractRole.MAX_SUMMARY_LENGTH + "个字。")
	@ExcelColumn(order = 1000, friendlyName = "说明", width = 300)
	private String summary;

	/**
	 * 实例化 AbstractRole
	 */
	public RoleDto() {

	}

	/**
	 * 获取顺序
	 * 
	 * @return
	 */
	public Integer getSortId() {
		return sortId;
	}

	/**
	 * 设置顺序
	 * 
	 * @param sortId
	 */
	public void setSortId(Integer sortId) {
		this.sortId = sortId;
	}

	/**
	 * 获取角色名称
	 * 
	 * @return
	 */
	public String getName() {
		return name;
	}

	/**
	 * 设置角色名称
	 * 
	 * @param name 角色名称
	 */
	public void setName(String name) {
		this.name = name;
	}

	/**
	 * 获取是否默认
	 * 
	 * @return
	 */
	public boolean getIsDefault() {
		return isDefault;
	}

	/**
	 * 设置是否默认
	 * 
	 * @param isDefault 是否默认
	 */
	public void setIsDefault(boolean isDefault) {
		this.isDefault = isDefault;
	}

	/**
	 * 获取摘要
	 * 
	 * @return
	 */
	public String getSummary() {
		return summary;
	}

	/**
	 * 设置摘要
	 * 
	 * @param summary 摘要
	 */
	public void setSummary(String summary) {
		this.summary = summary;
	}
}
